<?include ($_SERVER ["DOCUMENT_ROOT"] . "/lib/module/conn_db.php");?>
<?include ($_SERVER ["DOCUMENT_ROOT"] . "/lib/module/Util.php");?>
<?php $util=new Util();?>
<?include ($_SERVER ["DOCUMENT_ROOT"] . "/lib/module/BoardConf.php");?>
<?include ($_SERVER ["DOCUMENT_ROOT"] . "/lib/module/BoardArticle.php");?>
<?php $bConf=$_GET['bConf'];
$condition = $_GET ['condition']; // 검색영역
$words = $_GET ['words']; // 검색어
?>
<?php if (!$bConf) echo "<script>location.href='?bConf=5';</script>";?>
<? include "inc/inc_header.php" ?><!-- header -->
<?php $title = "질의 및 답변"; $sub_title="질의 및 답변";?>
<body style="background-repeat: repeat-x; overflow-x:hidden;" oncontextmenu="return false" onselectstart="return false" ondragstart="return false">
<?include ($_SERVER ["DOCUMENT_ROOT"] . "/lib/include/inc_board_article_list.php");?>
	<?$txt=9?>
	<? include "inc/inc_top.php" ?><!-- top -->
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	  <tr>
		<td style="BACKGROUND-IMAGE: url(img/surn/cont_bg04.jpg); BACKGROUND-REPEAT: repeat-x; BACKGROUND-position:right top;">&nbsp;</td>
		<td width="994" align="right" style="BACKGROUND-IMAGE: url(img/surn/cont_bg06.jpg); BACKGROUND-REPEAT: repeat-x; BACKGROUND-position:center top;padding-bottom:16px;"><table width="954" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
			  <tr>
						<td align="right" style="padding-bottom:10px;">
		<form name="frm" method="get" action="<?=$pageUrl?>">
		<table width="0" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td style="padding-right:4px"> <select name="condition" id="condition"  class="box01">
				  <option value="article_title" <?=$condition=="article_title" ? "selected" : "" ?>>제목</option>
				  <option value="article_contents1" <?=$condition=="article_contents1" ? "selected" : "" ?>>내용</option>
			  </select></td>
			  <td style="padding-right:4px">
			  <input type="hidden" name="bConf" value="<?=$bConf?>"/>
			  <input type="hidden" name="page" value="<?=$page?>"/>
			  <input type="text" name="words" title="검색어" class="box01" size="35" value="<?=$words?>" /></td>
			  <td><input type="image" src="img/board/btn_search.gif" alt="검색하기" style="width:50px;height:20px;"/></td>
			</tr>
		</table>
		</form>
		</td>
			  </tr>
			  <tr>
				<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
						  <td height="2" bgcolor="#212725"></td>
						</tr>
						<tr>
						  <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#585858">
							  <tr>
								<td width="8%" height="30" align="center" class="dbtit01"><strong>번호</strong></td>
								<td width="1"><img src="img/board/list_line.gif" width="1" height="8" /></td>
								<td width="68%" align="center" class="dbtit01"><strong>제목</strong></td>
								<td width="1"><img src="img/board/list_line.gif" width="1" height="8" /></td>
								<td width="14%" align="center" class="dbtit01"><strong>글쓴이</strong></td>
								<td width="1"><img src="img/board/list_line.gif" width="1" height="8" /></td>
								<td width="10%" align="center" class="dbtit01"><strong>조회수</strong></td>
							  </tr>
						  </table></td>
						</tr>
						<tr>
						  <td height="1" bgcolor="#585858"></td>
						</tr>
					</table></td>
				  </tr>
				  <tr>
					<td>
			  <?php if($total==0):?>
					  <table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
						  <td height="28"><table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
							  <tr>
								<td width="68%" align="center" class="dbtop9" style="padding-left:12px">No Data.</td>
							  </tr>
						  </table></td>
						</tr>
						<tr>
						  <td height="1" bgcolor="#BCBCBC"></td>
						</tr>
					  </table>
			  <?php else : ?>
				  <?php if($topTotal>0):?>
					<?php while($row = mysql_fetch_object($topResult)):?>
						  <table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
							  <td height="28"><table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
								  <tr>
									<td width="8%" align="center" class="dbtop9">[공지]</td>
									<td width="68%" align="left" class="dbtop9" style="padding-left:12px"><a href="ques01_v.php?sid=<?php echo $row->article_sid;?>&page=<?php echo $page;?>&<?=$addStr?>" class="dblink"><?=$util->mbstrcut($row->article_title,60)?></a></td>
									<td width="14%" align="center" class="dbtop9"><?php echo $row->article_writer;?></strong></td>
									<td width="10%" align="center" class="dbtop9"><?php echo $row->article_hits;?></td>
								  </tr>
							  </table></td>
							</tr>
							<tr>
							  <td height="1" bgcolor="#BCBCBC"></td>
							</tr>
						  </table>
					<?php endwhile;?>
				<?php endif;?>
				<?php while($row = mysql_fetch_object($result)):?>
					  <table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
						  <td height="28"><table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
							  <tr>
								<td width="8%" align="center" class="dbtop9"><?=$start_no?></td>
								<td width="68%" align="left" class="dbtop9" style="padding-left:12px">
								<?php if ($total-2 < $start_no) :?>
									<img src="img/board/bl01.gif" width="27" height="11" border="0" />
								<?php endif;?>
								<?			for($j=0; $j < $row->article_re_level; $j++) { ?>
									<label style="color:#fff">.</label>
								<? }?>
								<?
									if($row->article_re_step>0){
								?>
									<img src="admin/images/common/re.gif" />
								<?
									}
								?>
								<a href="ques01_v.php?sid=<?php echo $row->article_sid;?>&page=<?php echo $page;?>&<?=$addStr?>" class="dblink"><?=$util->mbstrcut($row->article_title,60)?></a></td>
								<td width="14%" align="center" class="dbtop9"><?php echo $row->article_writer;?></strong></td>
								<td width="10%" align="center" class="dbtop9"><?php echo $row->article_hits;?></td>
							  </tr>
						  </table></td>
						</tr>
						<tr>
						  <td height="1" bgcolor="#BCBCBC"></td>
						</tr>
					  </table>
					  <?$start_no--;?>
				<?php endwhile;?>
			  <?php endif;?>
					 </td>
				  </tr>
				</table></td>
			  </tr>
			  <tr>
				<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td height="30" align="right" valign="bottom"><a href="ques01_w.php?mode=write&<?=$addStr?>"><img src="img/board/bt_writes.gif" width="50" height="22" border="0"></a></td>
				  </tr>
				  <tr>
					<td align="center">
			<?php if ($total > 0) : ?>
				<table cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20">
					  <?php if($stpage-10>0): ?>
					    <a href="<?=$_SERVER["PHP_SELF"]?>?page=<?=$stpage-10?>&amp;<?=$addStr?>">
					      <img height="7" src="img/board/btn_prev_01.gif" width="9" align="absmiddle" border="0" />
						</a>
					  <?php endif;?>
					</td>
					<td width="20">
					  <a href="<?=$_SERVER["PHP_SELF"]?>?page=1&amp;<?=$addStr?>">
					    <img height="7" src="img/board/btn_prev_02.gif" width="5" align="absmiddle" border="0" />
					  </a>
					</td>
					<td align="middle" class="dbpaging">
					<?
						for($i=$stpage; ($i<=$edpage && $i<=$lastpage); $i++) {
							if($i<0)
							{
								continue;
							}
							if($i==$page)
							{
								echo "<a href='".$_SERVER['PHP_SELF']."?page=$i&amp;$addStr'><span class='dbbold'>".$i."</span></a>";
							}else{
								echo "<a href='".$_SERVER['PHP_SELF']."?page=$i&amp;$addStr' class='dblink'>".$i."</a>";
							}
						}
					?>
					</td>
					<td width="20" align="right">
					  <a href="<?=$_SERVER["PHP_SELF"]?>?page=<?=$lastpage?>&amp;<?=$addStr?>">
						<img src="img/board/btn_next_02.gif" width="5" height="7" border="0" align="absmiddle" />
					  </a>
					</td>
					<td width="20" align="right">
					  <?php if ($edpage < $lastpage):?>
					    <a href="<?=$_SERVER["PHP_SELF"]?>?page=<?=$stpage+10?>&amp;<?=$addStr?>">
						  <img height="7" src="img/board/btn_next_01.gif" width="9" align="absmiddle" border="0" />
					    </a>
					  <?php endif;?>
 </td>
			</tr>
		</table>
				   <?php endif;?>
				  </td>
				  </tr>
				</table></td>
			  </tr>
			</table></td>
		  </tr>
		</table></td>
		<td style="BACKGROUND-IMAGE: url(img/surn/cont_bg05.jpg); BACKGROUND-REPEAT: repeat-x; BACKGROUND-position:left top;">&nbsp;</td>
	  </tr>
	</table>
	<? include "inc/inc_bottom.php" ?><!-- bottom -->
<? include "inc/inc_footer.php" ?><!-- footer -->